<?php
function getListingTypeSelector()
{
	$type;
	if(listingExists(getLoggedInUser())){
		$listing = getListing(getLoggedInUser());
		$listing = $listing[0];
		$type = $listing['result_type_fk'];
	}
	//echo "El logged in user es ".getLoggedInUser()." el listing Type es ".$type;
	$listingCathegories = displayListingCathegories(ifsetor($type, ""));
	$typeSelectorHtml = "<div id=\"typeOfListingContainer\">
							<label for=\"typeOfListing\">Please select a type of listing: </label>
							<select name=\"typeofListing\" id=\"typeofListing\">
								<option value=\"\">select one</option>
								{$listingCathegories}
							</select>
						</div>"
						;

	$response = array(
		"htmlString"=>$typeSelectorHtml,
		"typeSelected"=>isset($type) ? $type : "",
		"error"=>false
	);
	echo getJSON($response);					
}

function getLEPersonal(){
	$type=1;
	$pk;
	$type;
	$title;
	$image_url;
	$telephone;
	$description;
	$price;
	$user;
	$email;
	$webpage;
	$roomType;
	$bedType;
	$accomodates;
	$bedrooms;
	$beds;
	$extraPeople;
	$weekPrice;
	$monthPrice;
	$cancellationFee;
	$rules;
	$cancellationType;
	//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
	$postcode;
	$city;
	$street;
	$house;
	$district;
	$rating;
	$lat;
	$lng;
	$addressPk;
	$locationPk;
	$listingExists = false;
	if(listingExists(getLoggedInUser())){
				$listing = getListing(getLoggedInUser());
				$listing = $listing[0];
				//print_r($listing);
				$listingExists = true;
				$pk = $listing['pk'];
				//$type = $listing['result_type_fk'];
				$title = $listing['title'];
				$image_url = getListingPicture();
				$telephone = $listing['telephone'];
				$description = $listing['description'];
				$price = $listing['price'];
				$user = $listing['user_fk'];
				$email = $listing['email'];
				$webpage = $listing['webpage'];
				$roomType = $listing['room_type_fk'];
				$bedType = $listing['bed_type_fk'];
				$accomodates = $listing['accomodates'];
				$bedrooms = $listing['bedrooms'];
				$beds = $listing['beds'];
				$extraPeople = $listing['extra_people'];
				$weekPrice = $listing['week_price'];
				$monthPrice = $listing['month_price'];
				$cancellationFee = $listing['cancellation_fee'];
				$rules = $listing['rules'];
				$cancellationType = $listing['cancellation_type_fk'];
				//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
				$postcode = $listing['postcode'];
				$city = $listing['city'];
				$street = $listing['street'];
				$house = $listing['house'];
				$district = $listing['district'];
				$rating = $listing['rating'];
				$lat = $listing['lat'];
				$lng = $listing['lng'];
				$addressPk = $listing['addressPk'];
				$locationPk = $listing['locationPk'];
			}

			$listingCathegories = displayListingCathegories(ifsetor($type, ""));
			$roomTypes = displayRoomTypes(ifsetor($roomType));
			$bedTypes = displayBedTypes(ifsetor($bedType));
			$cancellationTypes = displayCancellationTypes(ifsetor($cancellationType));
			$pictureUploader  =($listingExists ? "
						<div id=\"imageUrlListingPreviewer\" style=\"background-image: url('$image_url');\"></div>
						<a href=\"#\" id=\"editListingImages\">Edit images</a>
				" : "");
			//$pictureUploader = "";
			$htmlString = "<div id=\"listingFormContainer\">
			<form method=\"post\" enctype=\"multipart/form-data\" id=\"listingForm\" action=\"profile.php\">				
				<div id=\"listingFormBody\">

					<!--MAIN INFO -->
					<div id=\"LE-MainInfo\">
						<div>
							<div id=\"LE-mainInfoContainer\">
								<!-- MAIN INFO DETAILS -->
								<div class=\"LE-MainInfoDetails\">
									
									<div class=\"LE-MainInfoDetailsName\">
										<!--NAME OF LISTING -->
										<label for=\"nameListing\">Name: </label>
										<input type=\"text\" name=\"name\" id=\"nameListing\" value=\"".ifsetor($title, "")."\"/>
									</div>
									<div class=\"LE-MainInfoDetailsDescription\">
										<!--DESCRIPTION-->
										<label for=\"descriptionListing\">Description: </label>
										<textarea placeholder=\"Please write a description here\" name=\"description\" id=\"descriptionListing\">".ifsetor($description, "")." </textarea> 
									</div>
									<div class=\"LE-MainInfoDetailsPrice\">
										<div>
										<!--PRICE -->
											<label for=\"priceListing\">Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"price\" id=\"priceListing\" value=\"".ifsetor($price,"")."\"/>
										</div>
										<div>
											<!--WEEKLY PRICE -->
											<label for=\"weekPriceListing\">Weekly Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"weekPrice\" id=\"weekPriceListing\" value=\"".ifsetor($weekPrice, "")."\"/>
										</div>
										<div>
											<!--MONTHLY PRICE -->
											<label for=\"monthPriceListing\">Monthly Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"monthPrice\" id=\"monthPriceListing\" value=\"".ifsetor($monthPrice, "")."\"/>
										</div>
									</div>
									<div class=\"LE-MainInfoDetailsRoom\">
										<div>
											<!--TYPE OF ROOM -->
											<label for=\"roomTypeListing\">Room Type: </label>
											<select name=\"roomType\" id=\"roomTypeListing\">
												{$roomTypes}
											</select>
										</div>
										<div>
											<!--BEDROOMS -->
											<label for=\"bedroomsListing\">Bedrooms: </label>
											<input type=\"text\" class=\"inputNumber\" name=\"bedrooms\" id=\"bedroomsListing\" value=\"".ifsetor($bedrooms,"")."\"/>
										</div>
										<div>
											<!--TYPE OF BED -->
											<label for=\"bedTypeListing\">Bed Type: </label>
											<select name=\"bedType\" id=\"bedTypeListing\">
												{$bedTypes}
											</select>
										</div>
										<div>
											<!--BEDS -->
											<label for=\"bedsListing\">Beds: </label>
											<input type=\"text\" class=\"inputNumber\" name=\"beds\" id=\"bedsListing\" value=\"".ifsetor($beds, "")."\" />
										</div>
									</div>
								
								</div>



							</div>

							

							<!--LOCATION DETAILS-->
							<div id=\"LE-locationDetails\">
								<div id=\"LE-locationDetailsAddress\">
									<div class=\"LE-locationDetailsPostcode\">
										<!--POSTCODE -->
										<label for=\"postcodeListing\">Postcode: </label>
										<input type=\"text\" name=\"postcode\" id=\"postcodeListing\" value=\"".ifsetor($postcode, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsCity\">
										<!--CITY -->
										<label for=\"cityListing\">City: </label>
										<input type=\"text\" name=\"city\" id=\"cityListing\" value=\"".ifsetor($city, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsArea\">
										<!--DISTRICT/AREA -->
										<label for=\"areaListing\">District/Area: </label>
										<input type=\"text\" name=\"area\" id=\"areaListing\" value=\"".ifsetor($district, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsStreet\">
										<!--STREET -->
										<label for=\"streetNameListing\">Street Name: </label>
										<input type=\"text\" name=\"street\" id=\"streetNameListing\" value=\"".ifsetor($street, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsHouseNumber\">
										<!--HOUSE -->
										<label for=\"houseNumberListing\">House Number:<br/>(this remains private)</label>
										<input type=\"text\" name=\"houseNumber\" id=\"houseNumberListing\" value=\"".ifsetor($house,"")."\"/>
									</div>
									<input type=\"hidden\" id=\"coordsLatListing\" name=\"lat\" value=\"".ifsetor($lat, "")."\">
									<input type=\"hidden\" id=\"coordsLngListing\" name=\"lng\" value=\"".ifsetor($lng, "")."\">
								</div>

							</div>
						</div>
						<div>
							<div id=\"LE-locationDetailsMap\">

							</div>
						</div>
					</div>

					<!--CONTACT INFO -->
					<div id=\"LE-contactInfo\">
						<div class=\"LE-contactInfoTelephone\">
							<!--TELEPHONE NUMBER -->
							<label for=\"telephoneListing\">Telephone: </label>
							<input type=\"number\" name=\"telephone\" id=\"telephoneListing\" value=\"".ifsetor($telephone, "")."\"/>
						</div>
						<div class=\"LE-contactInfoEmail\">
							<!--EMAIL -->
							<label for=\"emailListing\">Email: </label>
							<input type=\"email\" name=\"email\" id=\"emailListing\" value=\"".ifsetor($email,"")."\"/>
						</div>
						<div class=\"LE-contactInfoWebpage\">
							<!--WEBPAGE ADDRESS -->
							<label for=\"webpageAddressListing\">Webpage Address: </label>
							<input type=\"text\" name=\"webpage\" placeholder=\"http://www.mysite.com\" id=\"webpageAddressListing\" value=\"".ifsetor($webpage, "")."\"/>
						</div>
					</div>

					<!-- EXTRA INFORMATION -->
					<div id=\"LE-extraInformation\">
						<div class=\"LE-extraInformation1\">
							<div>
								<!--NUMBER OF ACCOMODATES -->
								<label for=\"accomodatesListing\">Number of Accomodates</label>
								<input type=\"text\" name=\"accomodates\" id=\"accomodatesListing\" value=\"".ifsetor($accomodates,"")."\" />
							</div>
							<div>
								<!--EXTRA PEOPLE -->
								<label for=\"extraPeopleListing\">Extra People: </label>
								<select name=\"extraPeople\" id=\"extraPeopleListing\">
								  <option value=\"\">select a value</option> 
								  <option value=\"1\"".printSelected(ifsetor($extraPeople), "1").">allowed</option>
								  <option value=\"0\" ".printSelected(ifsetor($extraPeople), "0").">not allowed</option>
								</select>
							</div>
							<div>
								<!--CANCELLATION -->
								<label for=\"cancellationListing\">Cancellation</label>
								<select name=\"cancellation\" id=\"cancellationListing\">
									{$cancellationTypes}
								</select>
							</div>
							<div>
								<label for=\"cancellationFeeListing\">Cancellation Fee:</label>
								<input type=\"number\" name=\"cancellationFee\" id=\"cancellationFeeListing\" value=\"".ifsetor($cancellationFee,"")."\"/>
							</div>
							<div>
								<!--HOTEL RATING -->
								<label for=\"rating\">Rating</label>
								<select name=\"rating\" id=\"listingRating\">
								  <option value=\"\">select a value</option>
								  <option value=\"1\" ".printSelected(ifsetor($rating), "1").">1 star</option>
								  <option value=\"2\" ".printSelected(ifsetor($rating), "2").">2 star</option>
								  <option value=\"3\" ".printSelected(ifsetor($rating), "3").">3 star</option>
								  <option value=\"4\" ".printSelected(ifsetor($rating), "4").">4 star</option>
								  <option value=\"5\" ".printSelected(ifsetor($rating), "5").">5 star</option>
								</select>
							</div>
						</div>
						<!-- MAIN INFO PICTURE UPLOADER -->
						<div class=\"LE-mainInfoPictureUploader\">
							{$pictureUploader}
						</div>
						<div class=\"LE-extraInformationRules\">
							<!--RULES -->
							<label for=\"rules\">Rules</label>
							<textarea name=\"rules\" id=\"rulesListing\">".(ifsetor($type) == "1" ? ifsetor($rules) : "")."</textarea>
						</div>
					</div>

				</div>

				<div id=\"LE-buttons\">
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-cancelButton\">Cancel</a>
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-submitButton\">Submit</a>
				</div>
				<input type=\"hidden\" name=\"exantLocation\" value=\"".ifsetor($locationPk,"")."\">
				<input type=\"hidden\" name=\"exantAddress\" value=\"".ifsetor($addressPk,"")."\">
				<input type=\"hidden\" name=\"exant\" value =\"".ifsetor($pk,"")."\"> 
				<input type=\"hidden\" name=\"action\" value=\"updateListing\"/>
				<input type=\"hidden\" name=\"listingType\" value=\"1\"/>
			</form>
		</div>";
		//echo $htmlString;
		$response = array(
			"error"=> false,
			"htmlString"=>$htmlString
			);

		echo getJSON($response);
}

function getLEHotel(){
	$type=1;
	$pk;
	$type;
	$title;
	$image_url;
	$telephone;
	$description;
	$price;
	$user;
	$email;
	$webpage;
	$roomType;
	$bedType;
	$accomodates;
	$bedrooms;
	$beds;
	$extraPeople;
	$weekPrice;
	$monthPrice;
	$cancellationFee;
	$rules;
	$cancellationType;
	//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
	$postcode;
	$city;
	$street;
	$house;
	$district;
	$rating;
	$lat;
	$lng;
	$addressPk;
	$locationPk;
	$listingExists = false;
	if(listingExists(getLoggedInUser())){
				$listing = getListing(getLoggedInUser());
				$listing = $listing[0];
				//print_r($listing);
				$listingExists = true;
				$pk = $listing['pk'];
				//$type = $listing['result_type_fk'];
				$title = $listing['title'];
				$image_url = getListingPicture();
				$telephone = $listing['telephone'];
				$description = $listing['description'];
				$price = $listing['price'];
				$user = $listing['user_fk'];
				$email = $listing['email'];
				$webpage = $listing['webpage'];
				$roomType = $listing['room_type_fk'];
				$bedType = $listing['bed_type_fk'];
				$accomodates = $listing['accomodates'];
				$bedrooms = $listing['bedrooms'];
				$beds = $listing['beds'];
				$extraPeople = $listing['extra_people'];
				$weekPrice = $listing['week_price'];
				$monthPrice = $listing['month_price'];
				$cancellationFee = $listing['cancellation_fee'];
				$rules = $listing['rules'];
				$cancellationType = $listing['cancellation_type_fk'];
				//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
				$postcode = $listing['postcode'];
				$city = $listing['city'];
				$street = $listing['street'];
				$house = $listing['house'];
				$district = $listing['district'];
				$rating = $listing['rating'];
				$lat = $listing['lat'];
				$lng = $listing['lng'];
				$addressPk = $listing['addressPk'];
				$locationPk = $listing['locationPk'];
			}

			$listingCathegories = displayListingCathegories(ifsetor($type, ""));
			$roomTypes = displayRoomTypes(ifsetor($roomType));
			$bedTypes = displayBedTypes(ifsetor($bedType));
			$cancellationTypes = displayCancellationTypes(ifsetor($cancellationType));
			$pictureUploader  =($listingExists ? "
						<div id=\"imageUrlListingPreviewer\" style=\"background-image: url('$image_url');\"></div>
						<a href=\"#\" id=\"editListingImages\">Edit images</a>
				" : "");
			//$pictureUploader = "";
			$htmlString = "<div id=\"listingFormContainer\">
			<form method=\"post\" enctype=\"multipart/form-data\" id=\"listingForm\" action=\"profile.php\">				
				<div id=\"listingFormBody\">

					<!--MAIN INFO -->
					<div id=\"LE-MainInfo\">
						<div>
							<div id=\"LE-mainInfoContainer\">
								<!-- MAIN INFO DETAILS -->
								<div class=\"LE-MainInfoDetails\">
									
									<div class=\"LE-MainInfoDetailsName\">
										<!--NAME OF LISTING -->
										<label for=\"nameListing\">Name: </label>
										<input type=\"text\" name=\"name\" id=\"nameListing\" value=\"".ifsetor($title, "")."\"/>
									</div>
									<div class=\"LE-MainInfoDetailsDescription\">
										<!--DESCRIPTION-->
										<label for=\"descriptionListing\">Description: </label>
										<textarea placeholder=\"Please write a description here\" name=\"description\" id=\"descriptionListing\">".ifsetor($description, "")." </textarea> 
									</div>
									<div class=\"LE-MainInfoDetailsPrice\">
										<div>
										<!--PRICE -->
											<label for=\"priceListing\">Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"price\" id=\"priceListing\" value=\"".ifsetor($price,"")."\"/>
										</div>
										<div>
											<!--WEEKLY PRICE -->
											<label for=\"weekPriceListing\">Weekly Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"weekPrice\" id=\"weekPriceListing\" value=\"".ifsetor($weekPrice, "")."\"/>
										</div>
										<div>
											<!--MONTHLY PRICE -->
											<label for=\"monthPriceListing\">Monthly Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"monthPrice\" id=\"monthPriceListing\" value=\"".ifsetor($monthPrice, "")."\"/>
										</div>
									</div>
									<div class=\"LE-MainInfoDetailsRoom\">
										<div>
											<!--TYPE OF ROOM -->
											<label for=\"roomTypeListing\">Room Type: </label>
											<select name=\"roomType\" id=\"roomTypeListing\">
												{$roomTypes}
											</select>
										</div>
										<div>
											<!--BEDROOMS -->
											<label for=\"bedroomsListing\">Bedrooms: </label>
											<input type=\"text\" class=\"inputNumber\" name=\"bedrooms\" id=\"bedroomsListing\" value=\"".ifsetor($bedrooms,"")."\"/>
										</div>
										<div>
											<!--TYPE OF BED -->
											<label for=\"bedTypeListing\">Bed Type: </label>
											<select name=\"bedType\" id=\"bedTypeListing\">
												{$bedTypes}
											</select>
										</div>
										<div>
											<!--BEDS -->
											<label for=\"bedsListing\">Beds: </label>
											<input type=\"text\" class=\"inputNumber\" name=\"beds\" id=\"bedsListing\" value=\"".ifsetor($beds, "")."\" />
										</div>
									</div>
								
								</div>



							</div>

							

							<!--LOCATION DETAILS-->
							<div id=\"LE-locationDetails\">
								<div id=\"LE-locationDetailsAddress\">
									<div class=\"LE-locationDetailsPostcode\">
										<!--POSTCODE -->
										<label for=\"postcodeListing\">Postcode: </label>
										<input type=\"text\" name=\"postcode\" id=\"postcodeListing\" value=\"".ifsetor($postcode, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsCity\">
										<!--CITY -->
										<label for=\"cityListing\">City: </label>
										<input type=\"text\" name=\"city\" id=\"cityListing\" value=\"".ifsetor($city, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsArea\">
										<!--DISTRICT/AREA -->
										<label for=\"areaListing\">District/Area: </label>
										<input type=\"text\" name=\"area\" id=\"areaListing\" value=\"".ifsetor($district, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsStreet\">
										<!--STREET -->
										<label for=\"streetNameListing\">Street Name: </label>
										<input type=\"text\" name=\"street\" id=\"streetNameListing\" value=\"".ifsetor($street, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsHouseNumber\">
										<!--HOUSE -->
										<label for=\"houseNumberListing\">House Number:<br/>(this remains private)</label>
										<input type=\"text\" name=\"houseNumber\" id=\"houseNumberListing\" value=\"".ifsetor($house,"")."\"/>
									</div>
									<input type=\"hidden\" id=\"coordsLatListing\" name=\"lat\" value=\"".ifsetor($lat, "")."\">
									<input type=\"hidden\" id=\"coordsLngListing\" name=\"lng\" value=\"".ifsetor($lng, "")."\">
								</div>

							</div>
						</div>
						<div>
							<div id=\"LE-locationDetailsMap\">

							</div>
						</div>

					</div>

					<!--CONTACT INFO -->
					<div id=\"LE-contactInfo\">
						<div class=\"LE-contactInfoTelephone\">
							<!--TELEPHONE NUMBER -->
							<label for=\"telephoneListing\">Telephone: </label>
							<input type=\"number\" name=\"telephone\" id=\"telephoneListing\" value=\"".ifsetor($telephone, "")."\"/>
						</div>
						<div class=\"LE-contactInfoEmail\">
							<!--EMAIL -->
							<label for=\"emailListing\">Email: </label>
							<input type=\"email\" name=\"email\" id=\"emailListing\" value=\"".ifsetor($email,"")."\"/>
						</div>
						<div class=\"LE-contactInfoWebpage\">
							<!--WEBPAGE ADDRESS -->
							<label for=\"webpageAddressListing\">Webpage Address: </label>
							<input type=\"text\" name=\"webpage\" placeholder=\"http://www.mysite.com\" id=\"webpageAddressListing\" value=\"".ifsetor($webpage, "")."\"/>
						</div>
					</div>

					<!-- EXTRA INFORMATION -->
					<div id=\"LE-extraInformation\">
						<div class=\"LE-extraInformation1\">
							<div>
								<!--NUMBER OF ACCOMODATES -->
								<label for=\"accomodatesListing\">Number of Accomodates</label>
								<input type=\"text\" name=\"accomodates\" id=\"accomodatesListing\" value=\"".ifsetor($accomodates,"")."\" />
							</div>
							<div>
								<!--CANCELLATION -->
								<label for=\"cancellationListing\">Cancellation</label>
								<select name=\"cancellation\" id=\"cancellationListing\">
									{$cancellationTypes}
								</select>
							</div>
							<div>
								<label for=\"cancellationFeeListing\">Cancellation Fee:</label>
								<input type=\"number\" name=\"cancellationFee\" id=\"cancellationFeeListing\" value=\"".ifsetor($cancellationFee,"")."\"/>
							</div>
							<div>
								<!--HOTEL RATING -->
								<label for=\"rating\">Rating</label>
								<select name=\"rating\" id=\"listingRating\">
								  <option value=\"\">select a value</option>
								  <option value=\"1\" ".printSelected(ifsetor($rating), "1").">1 star</option>
								  <option value=\"2\" ".printSelected(ifsetor($rating), "2").">2 star</option>
								  <option value=\"3\" ".printSelected(ifsetor($rating), "3").">3 star</option>
								  <option value=\"4\" ".printSelected(ifsetor($rating), "4").">4 star</option>
								  <option value=\"5\" ".printSelected(ifsetor($rating), "5").">5 star</option>
								</select>
							</div>
						</div>
						<!-- MAIN INFO PICTURE UPLOADER -->
						<div class=\"LE-mainInfoPictureUploader\">
							{$pictureUploader}
						</div>
						<div class=\"LE-extraInformationRules\">
							<!--RULES -->
							<label for=\"rules\">Rules</label>
							<textarea name=\"rules\" id=\"rulesListing\">".(ifsetor($type) == "1" ? ifsetor($rules) : "")."</textarea>
						</div>
					</div>

				</div>

				<div id=\"LE-buttons\">
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-cancelButton\">Cancel</a>
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-submitButton\">Submit</a>
				</div>
				<input type=\"hidden\" name=\"exantLocation\" value=\"".ifsetor($locationPk,"")."\">
				<input type=\"hidden\" name=\"exantAddress\" value=\"".ifsetor($addressPk,"")."\">
				<input type=\"hidden\" name=\"exant\" value =\"".ifsetor($pk,"")."\"> 
				<input type=\"hidden\" name=\"action\" value=\"updateListing\"/>
				<input type=\"hidden\" name=\"listingType\" value=\"2\"/>
			</form>
		</div>";
		//echo $htmlString;
		$response = array(
			"error"=> false,
			"htmlString"=>$htmlString
			);

		echo getJSON($response);
}

function getLERestaurant(){
	$type=1;
	$pk;
	$type;
	$title;
	$image_url;
	$telephone;
	$description;
	$price;
	$user;
	$email;
	$webpage;
	$roomType;
	$bedType;
	$accomodates;
	$bedrooms;
	$beds;
	$extraPeople;
	$weekPrice;
	$monthPrice;
	$cancellationFee;
	$rules;
	$cancellationType;
	//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
	$postcode;
	$city;
	$street;
	$house;
	$district;
	$rating;
	$lat;
	$lng;
	$addressPk;
	$locationPk;
	$listingExists = false;
	if(listingExists(getLoggedInUser())){
				$listing = getListing(getLoggedInUser());
				$listing = $listing[0];
				//print_r($listing);
				$listingExists = true;
				$pk = $listing['pk'];
				//$type = $listing['result_type_fk'];
				$title = $listing['title'];
				$image_url = getListingPicture();
				$telephone = $listing['telephone'];
				$description = $listing['description'];
				$price = $listing['price'];
				$user = $listing['user_fk'];
				$email = $listing['email'];
				$webpage = $listing['webpage'];
				$roomType = $listing['room_type_fk'];
				$bedType = $listing['bed_type_fk'];
				$accomodates = $listing['accomodates'];
				$bedrooms = $listing['bedrooms'];
				$beds = $listing['beds'];
				$extraPeople = $listing['extra_people'];
				$weekPrice = $listing['week_price'];
				$monthPrice = $listing['month_price'];
				$cancellationFee = $listing['cancellation_fee'];
				$rules = $listing['rules'];
				$cancellationType = $listing['cancellation_type_fk'];
				//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
				$postcode = $listing['postcode'];
				$city = $listing['city'];
				$street = $listing['street'];
				$house = $listing['house'];
				$district = $listing['district'];
				$rating = $listing['rating'];
				$lat = $listing['lat'];
				$lng = $listing['lng'];
				$addressPk = $listing['addressPk'];
				$locationPk = $listing['locationPk'];
			}

			$listingCathegories = displayListingCathegories(ifsetor($type, ""));
			$roomTypes = displayRoomTypes(ifsetor($roomType));
			$bedTypes = displayBedTypes(ifsetor($bedType));
			$cancellationTypes = displayCancellationTypes(ifsetor($cancellationType));
			$pictureUploader  =($listingExists ? "
						<div id=\"imageUrlListingPreviewer\" style=\"background-image: url('$image_url');\"></div>
						<a href=\"#\" id=\"editListingImages\">Edit images</a>
				" : "");
			//$pictureUploader = "";
			$htmlString = "<div id=\"listingFormContainer\">
			<form method=\"post\" enctype=\"multipart/form-data\" id=\"listingForm\" action=\"profile.php\">				
				<div id=\"listingFormBody\">

					<!--MAIN INFO -->
					<div id=\"LE-MainInfo\">
						<div>
							<div id=\"LE-mainInfoContainer\">
								<!-- MAIN INFO DETAILS -->
								<div class=\"LE-MainInfoDetails\">
									
									<div class=\"LE-MainInfoDetailsName\">
										<!--NAME OF LISTING -->
										<label for=\"nameListing\">Name: </label>
										<input type=\"text\" name=\"name\" id=\"nameListing\" value=\"".ifsetor($title, "")."\"/>
									</div>
									<div class=\"LE-MainInfoDetailsDescription\">
										<!--DESCRIPTION-->
										<label for=\"descriptionListing\">Description: </label>
										<textarea placeholder=\"Please write a description here\" name=\"description\" id=\"descriptionListing\">".ifsetor($description, "")." </textarea> 
									</div>
									<div class=\"LE-MainInfoDetailsPrice\">
										<div>
										<!--PRICE -->
											<label for=\"priceListing\">Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"price\" id=\"priceListing\" value=\"".ifsetor($price,"")."\"/>
										</div>
										
									</div>							
								</div>



							</div>

							<!--LOCATION DETAILS-->
							<div id=\"LE-locationDetails\">
								<div id=\"LE-locationDetailsAddress\">
									<div class=\"LE-locationDetailsPostcode\">
										<!--POSTCODE -->
										<label for=\"postcodeListing\">Postcode: </label>
										<input type=\"text\" name=\"postcode\" id=\"postcodeListing\" value=\"".ifsetor($postcode, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsCity\">
										<!--CITY -->
										<label for=\"cityListing\">City: </label>
										<input type=\"text\" name=\"city\" id=\"cityListing\" value=\"".ifsetor($city, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsArea\">
										<!--DISTRICT/AREA -->
										<label for=\"areaListing\">District/Area: </label>
										<input type=\"text\" name=\"area\" id=\"areaListing\" value=\"".ifsetor($district, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsStreet\">
										<!--STREET -->
										<label for=\"streetNameListing\">Street Name: </label>
										<input type=\"text\" name=\"street\" id=\"streetNameListing\" value=\"".ifsetor($street, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsHouseNumber\">
										<!--HOUSE -->
										<label for=\"houseNumberListing\">House Number:<br/>(this remains private)</label>
										<input type=\"text\" name=\"houseNumber\" id=\"houseNumberListing\" value=\"".ifsetor($house,"")."\"/>
									</div>
									<input type=\"hidden\" id=\"coordsLatListing\" name=\"lat\" value=\"".ifsetor($lat, "")."\">
									<input type=\"hidden\" id=\"coordsLngListing\" name=\"lng\" value=\"".ifsetor($lng, "")."\">
								</div>

							</div>
						</div>
						<div>
							<div id=\"LE-locationDetailsMap\">

							</div>
						</div>

					</div>

					<!--CONTACT INFO -->
					<div id=\"LE-contactInfo\">
						<div class=\"LE-contactInfoTelephone\">
							<!--TELEPHONE NUMBER -->
							<label for=\"telephoneListing\">Telephone: </label>
							<input type=\"number\" name=\"telephone\" id=\"telephoneListing\" value=\"".ifsetor($telephone, "")."\"/>
						</div>
						<div class=\"LE-contactInfoEmail\">
							<!--EMAIL -->
							<label for=\"emailListing\">Email: </label>
							<input type=\"email\" name=\"email\" id=\"emailListing\" value=\"".ifsetor($email,"")."\"/>
						</div>
						<div class=\"LE-contactInfoWebpage\">
							<!--WEBPAGE ADDRESS -->
							<label for=\"webpageAddressListing\">Webpage Address: </label>
							<input type=\"text\" name=\"webpage\" placeholder=\"http://www.mysite.com\" id=\"webpageAddressListing\" value=\"".ifsetor($webpage, "")."\"/>
						</div>
					</div>

					<!-- EXTRA INFORMATION -->
					<div id=\"LE-extraInformation\">
						<div class=\"LE-extraInformation1\">
							<div>
								<!--CANCELLATION -->
								<label for=\"cancellationListing\">Cancellation</label>
								<select name=\"cancellation\" id=\"cancellationListing\">
									{$cancellationTypes}
								</select>
							</div>
							<div>
								<label for=\"cancellationFeeListing\">Cancellation Fee:</label>
								<input type=\"number\" name=\"cancellationFee\" id=\"cancellationFeeListing\" value=\"".ifsetor($cancellationFee,"")."\"/>
							</div>
						</div>
						<!-- MAIN INFO PICTURE UPLOADER -->
						<div class=\"LE-mainInfoPictureUploader\">
							{$pictureUploader}
						</div>
						<div class=\"LE-extraInformationRules\">
							<!--RULES -->
							<label for=\"rules\">Rules</label>
							<textarea name=\"rules\" id=\"rulesListing\">".(ifsetor($type) == "1" ? ifsetor($rules) : "")."</textarea>
						</div>
					</div>

				</div>

				<div id=\"LE-buttons\">
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-cancelButton\">Cancel</a>
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-submitButton\">Submit</a>
				</div>
				<input type=\"hidden\" name=\"exantLocation\" value=\"".ifsetor($locationPk,"")."\">
				<input type=\"hidden\" name=\"exantAddress\" value=\"".ifsetor($addressPk,"")."\">
				<input type=\"hidden\" name=\"exant\" value =\"".ifsetor($pk,"")."\"> 
				<input type=\"hidden\" name=\"action\" value=\"updateListing\"/>
				<input type=\"hidden\" name=\"listingType\" value=\"3\"/>
			</form>
		</div>";
		//echo $htmlString;
		$response = array(
			"error"=> false,
			"htmlString"=>$htmlString
			);

		echo getJSON($response);
}

function getLEBar(){
	$type=1;
	$pk;
	$type;
	$title;
	$image_url;
	$telephone;
	$description;
	$price;
	$user;
	$email;
	$webpage;
	$roomType;
	$bedType;
	$accomodates;
	$bedrooms;
	$beds;
	$extraPeople;
	$weekPrice;
	$monthPrice;
	$cancellationFee;
	$rules;
	$cancellationType;
	//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
	$postcode;
	$city;
	$street;
	$house;
	$district;
	$rating;
	$lat;
	$lng;
	$addressPk;
	$locationPk;
	$listingExists = false;
	if(listingExists(getLoggedInUser())){
				$listing = getListing(getLoggedInUser());
				$listing = $listing[0];
				//print_r($listing);
				$listingExists = true;
				$pk = $listing['pk'];
				//$type = $listing['result_type_fk'];
				$title = $listing['title'];
				$image_url = getListingPicture();
				$telephone = $listing['telephone'];
				$description = $listing['description'];
				$price = $listing['price'];
				$user = $listing['user_fk'];
				$email = $listing['email'];
				$webpage = $listing['webpage'];
				$roomType = $listing['room_type_fk'];
				$bedType = $listing['bed_type_fk'];
				$accomodates = $listing['accomodates'];
				$bedrooms = $listing['bedrooms'];
				$beds = $listing['beds'];
				$extraPeople = $listing['extra_people'];
				$weekPrice = $listing['week_price'];
				$monthPrice = $listing['month_price'];
				$cancellationFee = $listing['cancellation_fee'];
				$rules = $listing['rules'];
				$cancellationType = $listing['cancellation_type_fk'];
				//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
				$postcode = $listing['postcode'];
				$city = $listing['city'];
				$street = $listing['street'];
				$house = $listing['house'];
				$district = $listing['district'];
				$rating = $listing['rating'];
				$lat = $listing['lat'];
				$lng = $listing['lng'];
				$addressPk = $listing['addressPk'];
				$locationPk = $listing['locationPk'];
			}

			$listingCathegories = displayListingCathegories(ifsetor($type, ""));
			$roomTypes = displayRoomTypes(ifsetor($roomType));
			$bedTypes = displayBedTypes(ifsetor($bedType));
			$cancellationTypes = displayCancellationTypes(ifsetor($cancellationType));
			$pictureUploader  =($listingExists ? "
						<div id=\"imageUrlListingPreviewer\" style=\"background-image: url('$image_url');\"></div>
						<a href=\"#\" id=\"editListingImages\">Edit images</a>
				" : "");
			//$pictureUploader = "";
			$htmlString = "<div id=\"listingFormContainer\">
			<form method=\"post\" enctype=\"multipart/form-data\" id=\"listingForm\" action=\"profile.php\">				
				<div id=\"listingFormBody\">

					<!--MAIN INFO -->
					<div id=\"LE-MainInfo\">
						<div>
							<div id=\"LE-mainInfoContainer\">
								<!-- MAIN INFO DETAILS -->
								<div class=\"LE-MainInfoDetails\">
									
									<div class=\"LE-MainInfoDetailsName\">
										<!--NAME OF LISTING -->
										<label for=\"nameListing\">Name: </label>
										<input type=\"text\" name=\"name\" id=\"nameListing\" value=\"".ifsetor($title, "")."\"/>
									</div>
									<div class=\"LE-MainInfoDetailsDescription\">
										<!--DESCRIPTION-->
										<label for=\"descriptionListing\">Description: </label>
										<textarea placeholder=\"Please write a description here\" name=\"description\" id=\"descriptionListing\">".ifsetor($description, "")." </textarea> 
									</div>
									<div class=\"LE-MainInfoDetailsPrice\">
										<div>
										<!--PRICE -->
											<label for=\"priceListing\">Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"price\" id=\"priceListing\" value=\"".ifsetor($price,"")."\"/>
										</div>
										
									</div>							
								</div>



							</div>

							<!--LOCATION DETAILS-->
							<div id=\"LE-locationDetails\">
								<div id=\"LE-locationDetailsAddress\">
									<div class=\"LE-locationDetailsPostcode\">
										<!--POSTCODE -->
										<label for=\"postcodeListing\">Postcode: </label>
										<input type=\"text\" name=\"postcode\" id=\"postcodeListing\" value=\"".ifsetor($postcode, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsCity\">
										<!--CITY -->
										<label for=\"cityListing\">City: </label>
										<input type=\"text\" name=\"city\" id=\"cityListing\" value=\"".ifsetor($city, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsArea\">
										<!--DISTRICT/AREA -->
										<label for=\"areaListing\">District/Area: </label>
										<input type=\"text\" name=\"area\" id=\"areaListing\" value=\"".ifsetor($district, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsStreet\">
										<!--STREET -->
										<label for=\"streetNameListing\">Street Name: </label>
										<input type=\"text\" name=\"street\" id=\"streetNameListing\" value=\"".ifsetor($street, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsHouseNumber\">
										<!--HOUSE -->
										<label for=\"houseNumberListing\">House Number:<br/>(this remains private)</label>
										<input type=\"text\" name=\"houseNumber\" id=\"houseNumberListing\" value=\"".ifsetor($house,"")."\"/>
									</div>
									<input type=\"hidden\" id=\"coordsLatListing\" name=\"lat\" value=\"".ifsetor($lat, "")."\">
									<input type=\"hidden\" id=\"coordsLngListing\" name=\"lng\" value=\"".ifsetor($lng, "")."\">
								</div>

							</div>
						</div>
						<div>
							<div id=\"LE-locationDetailsMap\">

							</div>
						</div>

					</div>

					<!--CONTACT INFO -->
					<div id=\"LE-contactInfo\">
						<div class=\"LE-contactInfoTelephone\">
							<!--TELEPHONE NUMBER -->
							<label for=\"telephoneListing\">Telephone: </label>
							<input type=\"number\" name=\"telephone\" id=\"telephoneListing\" value=\"".ifsetor($telephone, "")."\"/>
						</div>
						<div class=\"LE-contactInfoEmail\">
							<!--EMAIL -->
							<label for=\"emailListing\">Email: </label>
							<input type=\"email\" name=\"email\" id=\"emailListing\" value=\"".ifsetor($email,"")."\"/>
						</div>
						<div class=\"LE-contactInfoWebpage\">
							<!--WEBPAGE ADDRESS -->
							<label for=\"webpageAddressListing\">Webpage Address: </label>
							<input type=\"text\" name=\"webpage\" placeholder=\"http://www.mysite.com\" id=\"webpageAddressListing\" value=\"".ifsetor($webpage, "")."\"/>
						</div>
					</div>

					<!-- EXTRA INFORMATION -->
					<div id=\"LE-extraInformation\">
						<div class=\"LE-extraInformation1\">
							<div>
								<!--CANCELLATION -->
								<label for=\"cancellationListing\">Cancellation</label>
								<select name=\"cancellation\" id=\"cancellationListing\">
									{$cancellationTypes}
								</select>
							</div>
							<div>
								<label for=\"cancellationFeeListing\">Cancellation Fee:</label>
								<input type=\"number\" name=\"cancellationFee\" id=\"cancellationFeeListing\" value=\"".ifsetor($cancellationFee,"")."\"/>
							</div>
						</div>
						<!-- MAIN INFO PICTURE UPLOADER -->
						<div class=\"LE-mainInfoPictureUploader\">
							{$pictureUploader}
						</div>
						<div class=\"LE-extraInformationRules\">
							<!--RULES -->
							<label for=\"rules\">Rules</label>
							<textarea name=\"rules\" id=\"rulesListing\">".(ifsetor($type) == "1" ? ifsetor($rules) : "")."</textarea>
						</div>
					</div>

				</div>

				<div id=\"LE-buttons\">
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-cancelButton\">Cancel</a>
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-submitButton\">Submit</a>
				</div>
				<input type=\"hidden\" name=\"exantLocation\" value=\"".ifsetor($locationPk,"")."\">
				<input type=\"hidden\" name=\"exantAddress\" value=\"".ifsetor($addressPk,"")."\">
				<input type=\"hidden\" name=\"exant\" value =\"".ifsetor($pk,"")."\"> 
				<input type=\"hidden\" name=\"action\" value=\"updateListing\"/>
				<input type=\"hidden\" name=\"listingType\" value=\"4\"/>
			</form>
		</div>";
		//echo $htmlString;
		$response = array(
			"error"=> false,
			"htmlString"=>$htmlString
			);

		echo getJSON($response);
}

function getLEEntertainment(){
	$type=1;
	$pk;
	$type;
	$title;
	$image_url;
	$telephone;
	$description;
	$price;
	$user;
	$email;
	$webpage;
	$roomType;
	$bedType;
	$accomodates;
	$bedrooms;
	$beds;
	$extraPeople;
	$weekPrice;
	$monthPrice;
	$cancellationFee;
	$rules;
	$cancellationType;
	//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
	$postcode;
	$city;
	$street;
	$house;
	$district;
	$rating;
	$lat;
	$lng;
	$addressPk;
	$locationPk;
	$listingExists = false;
	if(listingExists(getLoggedInUser())){
				$listing = getListing(getLoggedInUser());
				$listing = $listing[0];
				//print_r($listing);
				$listingExists = true;
				$pk = $listing['pk'];
				//$type = $listing['result_type_fk'];
				$title = $listing['title'];
				$image_url = getListingPicture();
				$telephone = $listing['telephone'];
				$description = $listing['description'];
				$price = $listing['price'];
				$user = $listing['user_fk'];
				$email = $listing['email'];
				$webpage = $listing['webpage'];
				$roomType = $listing['room_type_fk'];
				$bedType = $listing['bed_type_fk'];
				$accomodates = $listing['accomodates'];
				$bedrooms = $listing['bedrooms'];
				$beds = $listing['beds'];
				$extraPeople = $listing['extra_people'];
				$weekPrice = $listing['week_price'];
				$monthPrice = $listing['month_price'];
				$cancellationFee = $listing['cancellation_fee'];
				$rules = $listing['rules'];
				$cancellationType = $listing['cancellation_type_fk'];
				//$address = ($listing['house'] == "" ? "" : $listing['house']).($listing['street'] == "" ? "" : $listing['street']).($listing['district'] == "" ? "" : $listing['district']).($listing['city'] == "" ? "" : $listing['city']);
				$postcode = $listing['postcode'];
				$city = $listing['city'];
				$street = $listing['street'];
				$house = $listing['house'];
				$district = $listing['district'];
				$rating = $listing['rating'];
				$lat = $listing['lat'];
				$lng = $listing['lng'];
				$addressPk = $listing['addressPk'];
				$locationPk = $listing['locationPk'];
			}

			$listingCathegories = displayListingCathegories(ifsetor($type, ""));
			$roomTypes = displayRoomTypes(ifsetor($roomType));
			$bedTypes = displayBedTypes(ifsetor($bedType));
			$cancellationTypes = displayCancellationTypes(ifsetor($cancellationType));
			$pictureUploader  =($listingExists ? "
						<div id=\"imageUrlListingPreviewer\" style=\"background-image: url('$image_url');\"></div>
						<a href=\"#\" id=\"editListingImages\">Edit images</a>
				" : "");
			//$pictureUploader = "";
			$htmlString = "<div id=\"listingFormContainer\">
			<form method=\"post\" enctype=\"multipart/form-data\" id=\"listingForm\" action=\"profile.php\">				
				<div id=\"listingFormBody\">

					<!--MAIN INFO -->
					<div id=\"LE-MainInfo\">
						<div>
							<div id=\"LE-mainInfoContainer\">
								<!-- MAIN INFO DETAILS -->
								<div class=\"LE-MainInfoDetails\">
									
									<div class=\"LE-MainInfoDetailsName\">
										<!--NAME OF LISTING -->
										<label for=\"nameListing\">Name: </label>
										<input type=\"text\" name=\"name\" id=\"nameListing\" value=\"".ifsetor($title, "")."\"/>
									</div>
									<div class=\"LE-MainInfoDetailsDescription\">
										<!--DESCRIPTION-->
										<label for=\"descriptionListing\">Description: </label>
										<textarea placeholder=\"Please write a description here\" name=\"description\" id=\"descriptionListing\">".ifsetor($description, "")." </textarea> 
									</div>
									<div class=\"LE-MainInfoDetailsPrice\">
										<div>
										<!--PRICE -->
											<label for=\"priceListing\">Price: </label>
											<input type=\"number\" class=\"inputPrice\" name=\"price\" id=\"priceListing\" value=\"".ifsetor($price,"")."\"/>
										</div>
										
									</div>							
								</div>



							</div>

							<!--LOCATION DETAILS-->
							<div id=\"LE-locationDetails\">
								<div id=\"LE-locationDetailsAddress\">
									<div class=\"LE-locationDetailsPostcode\">
										<!--POSTCODE -->
										<label for=\"postcodeListing\">Postcode: </label>
										<input type=\"text\" name=\"postcode\" id=\"postcodeListing\" value=\"".ifsetor($postcode, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsCity\">
										<!--CITY -->
										<label for=\"cityListing\">City: </label>
										<input type=\"text\" name=\"city\" id=\"cityListing\" value=\"".ifsetor($city, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsArea\">
										<!--DISTRICT/AREA -->
										<label for=\"areaListing\">District/Area: </label>
										<input type=\"text\" name=\"area\" id=\"areaListing\" value=\"".ifsetor($district, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsStreet\">
										<!--STREET -->
										<label for=\"streetNameListing\">Street Name: </label>
										<input type=\"text\" name=\"street\" id=\"streetNameListing\" value=\"".ifsetor($street, "")."\"/>
									</div>
									<div class=\"LE-locationDetailsHouseNumber\">
										<!--HOUSE -->
										<label for=\"houseNumberListing\">House Number:<br/>(this remains private)</label>
										<input type=\"text\" name=\"houseNumber\" id=\"houseNumberListing\" value=\"".ifsetor($house,"")."\"/>
									</div>
									<input type=\"hidden\" id=\"coordsLatListing\" name=\"lat\" value=\"".ifsetor($lat, "")."\">
									<input type=\"hidden\" id=\"coordsLngListing\" name=\"lng\" value=\"".ifsetor($lng, "")."\">
								</div>

							</div>
						</div>
						<div>
							<div id=\"LE-locationDetailsMap\">

							</div>
						</div>

					</div>

					<!--CONTACT INFO -->
					<div id=\"LE-contactInfo\">
						<div class=\"LE-contactInfoTelephone\">
							<!--TELEPHONE NUMBER -->
							<label for=\"telephoneListing\">Telephone: </label>
							<input type=\"number\" name=\"telephone\" id=\"telephoneListing\" value=\"".ifsetor($telephone, "")."\"/>
						</div>
						<div class=\"LE-contactInfoEmail\">
							<!--EMAIL -->
							<label for=\"emailListing\">Email: </label>
							<input type=\"email\" name=\"email\" id=\"emailListing\" value=\"".ifsetor($email,"")."\"/>
						</div>
						<div class=\"LE-contactInfoWebpage\">
							<!--WEBPAGE ADDRESS -->
							<label for=\"webpageAddressListing\">Webpage Address: </label>
							<input type=\"text\" name=\"webpage\" placeholder=\"http://www.mysite.com\" id=\"webpageAddressListing\" value=\"".ifsetor($webpage, "")."\"/>
						</div>
					</div>

					<!-- EXTRA INFORMATION -->
					<div id=\"LE-extraInformation\">
						<div class=\"LE-extraInformation1\">
							<div>
								<!--CANCELLATION -->
								<label for=\"cancellationListing\">Cancellation</label>
								<select name=\"cancellation\" id=\"cancellationListing\">
									{$cancellationTypes}
								</select>
							</div>
							<div>
								<label for=\"cancellationFeeListing\">Cancellation Fee:</label>
								<input type=\"number\" name=\"cancellationFee\" id=\"cancellationFeeListing\" value=\"".ifsetor($cancellationFee,"")."\"/>
							</div>
						</div>
						<!-- MAIN INFO PICTURE UPLOADER -->
						<div class=\"LE-mainInfoPictureUploader\">
							{$pictureUploader}
						</div>
						<div class=\"LE-extraInformationRules\">
							<!--RULES -->
							<label for=\"rules\">Rules</label>
							<textarea name=\"rules\" id=\"rulesListing\">".(ifsetor($type) == "1" ? ifsetor($rules) : "")."</textarea>
						</div>
					</div>

				</div>

				<div id=\"LE-buttons\">
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-cancelButton\">Cancel</a>
					<a href=\"#\" class=\"nextBackButton\" id=\"LE-submitButton\">Submit</a>
				</div>
				<input type=\"hidden\" name=\"exantLocation\" value=\"".ifsetor($locationPk,"")."\">
				<input type=\"hidden\" name=\"exantAddress\" value=\"".ifsetor($addressPk,"")."\">
				<input type=\"hidden\" name=\"exant\" value =\"".ifsetor($pk,"")."\"> 
				<input type=\"hidden\" name=\"action\" value=\"updateListing\"/>
				<input type=\"hidden\" name=\"listingType\" value=\"5\"/>
			</form>
		</div>";
		//echo $htmlString;
		$response = array(
			"error"=> false,
			"htmlString"=>$htmlString
			);

		echo getJSON($response);
}
?>